//
//  FQDLabPublishCell.m
//  FakeQDaily
//
//  Created by mewxiv on 9/16/16.
//  Copyright © 2016 Xensius. All rights reserved.
//

#import "FQDLabPublishCell.h"

#import "Masonry.h"

@interface FQDLabPublishCell ()

@property (nonatomic, strong) UIImageView *dashBgImageView;
@property (nonatomic, strong) UIButton *penButton;

@end

@implementation FQDLabPublishCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self prepareUI];
    }
    return self;
}

- (void)prepareUI
{
    UIImage *dashImage = [UIImage imageNamed:@"mobPublishBg"];
    _dashBgImageView = [[UIImageView alloc] initWithImage:dashImage];
    [self.contentView addSubview:_dashBgImageView];
    
    UIImage *penImage = [UIImage imageNamed:@"mobFeedCellPencil"];
    UIColor *penTitleColor = [UIColor colorWithWhite:0.2f alpha:1.0f];
    _penButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_penButton setTitle:@"说点什么" forState:UIControlStateNormal];
    [_penButton setTitleColor:penTitleColor forState:UIControlStateNormal];
    [_penButton setImage:penImage forState:UIControlStateNormal];
    [_penButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 3, 0, -3)];
    [_penButton setImageEdgeInsets:UIEdgeInsetsMake(0, -3, 0, 3)];
    [_penButton setContentEdgeInsets:UIEdgeInsetsMake(0, 3, 0, 3)];
    [self.contentView addSubview:_penButton];
    
    WeakSelf;
    [_dashBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.contentView).offset(10);
        make.left.right.and.bottom.equalTo(weakSelf.contentView);
    }];
    
    [_penButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(weakSelf.contentView);
        make.centerY.equalTo(weakSelf.contentView).offset(5);
        make.height.equalTo(@20);
    }];
}

+ (NSString *)reuseId
{
    return @"FQDLabPublishCell";
}

@end
